package top.v5it.japi.plus.data.support.repository;

import top.v5it.japi.plus.data.support.entity.*;

import java.util.List;

/**
 * 框架支持必要实体数据服务
 *
 * @author zhanpu
 * @date 2022/6/13
 */
public interface EntityDataRepository {

    /**
     * 查询服务端所有证书信息
     */
    String SELECT_CERTS = "select t.name as name, t.public_key as publicKey, t.private_key as privateKey, t.serial_no as serialNo, t.start_time as startTime, t.end_time as endTime from sv_cert as t";

    /**
     * 查询所有接入渠道信息
     */
    String SELECT_CHANNELS = "select t.channel as channel, t.name as name, t.start_time as startTime, t.end_time as endTime from sv_channel as t";

    /**
     * 查询所有客户端证书信息
     */
    String SELECT_CLIENTCERTS = "select t.client_id as clientId, t.name as name, t.public_key as publicKey, t.private_key as privateKey, t.serial_no as serialNo, t.start_time as startTime, t.end_time as endTime from sv_client_cert as t";

    /**
     * 查询所有场所与接入渠道信息
     */
    String SELECT_SITECHANNELS = "select t.status as status, t.channel as channel, t.site_id as siteId, t.start_time as startTime, t.end_time as endTime from sv_site_channel as t";

    /**
     * 查询所有带密钥的接入渠道信息
     */
    String SELECT_KEYCHANNELS = "select t.channel as channel, t.name as name, t.aes_key as aesKey, t.sign_key as signKey, t.start_time as startTime, t.end_time as endTime from sv_key_channel as t";

    /**
     * 获取所有服务端证书信息
     *
     * @return 服务端证书信息
     */
    List<Cert> certs();

    /**
     * 获取所有接入渠道信息
     *
     * @return 渠道信息
     */
    List<Channel> channels();

    /**
     * 获取所有客户端证书信息
     *
     * @return 客户端证书信息
     */
    List<ClientCert> clientCerts();

    /**
     * 获取所有场所与接入渠道信息
     *
     * @return 场所与渠道信息
     */
    List<SiteChannel> siteChannels();

    /**
     * 获取所有带密钥渠道信息
     *
     * @return 带密钥渠道信息
     */
    List<KeyChannel> keyChannels();
}
